﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Skyworth.CRM.Service.Entity;
using Skyworth.CRM.Service.IBLL;
using Skyworth.CRM.Service.IDAL;

namespace Skyworth.CRM.BLL
{
   public class PricePolicyBLL:IPricePolicyBLL
    {
        private IPricePolicyDAL _pricePolicyDAL;

        public PricePolicyBLL(IPricePolicyDAL pricePolicyDal)
        {
            _pricePolicyDAL = pricePolicyDal;
        }

       public void Add(PricePolicy model)
       {
          _pricePolicyDAL.Add(model);
       }

       public void Update(PricePolicy model)
       {
           _pricePolicyDAL.Update(model);
       }

       public DataTable Query(string strWhere, Hashtable parameter)
       {
           return _pricePolicyDAL.Query(strWhere, parameter);
       }

       public void Delete(int policyId)
       {
           _pricePolicyDAL.Delete(policyId);
       }

       public PricePolicy GetPolicyById(int policyId)
       {
          return _pricePolicyDAL.GetPolicyById(policyId);
       }

       public DataTable GetPoliciesByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _pricePolicyDAL.GetPoliciesByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                    out pageCount);
       }
    }
}
